import os.path
from pydantic import Field
from infrastructure.excel import ExcelReader


# 定义mcp工具函数
def excel_to_json_array_tool(
        excel_file: str = Field(..., description='excel文件绝对路径路径')
) -> list[list]:
    """
    将excel表格数据转换为json二维数组
    :param excel_file: excel文件路径
    :return: json二维数组
    """
    json_array = ExcelReader.read_excel_as_json_array(excel_file)
    return json_array
